package com.aplink.generic.dialog;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;

public class GenericAlertDialog {
    public static Dialog newDialog( Context context, int icon, String message,
                                    String title ) {
        final AlertDialog.Builder builder = new AlertDialog.Builder( context );
        builder.setTitle( title ).setMessage( message ).setIcon( icon );
        builder.setCancelable( false ).setPositiveButton( android.R.string.ok,
                null );
        return builder.create();
    }

    public static Dialog newWarningDialog( Context context, String message,
                                           String title ) {
        return newDialog( context, android.R.drawable.ic_dialog_alert, message,
                title );
    }

    public static Dialog newInfoDialog( Context context, String message,
                                        String title ) {
        return newDialog( context, android.R.drawable.ic_dialog_info, message,
                title );
    }

}
